import request from "../utils/axios"
// 获取用户申购订单列表
export const userStockOrder = (params) => {
   return request.get(`/v1/index/stock-subscribe-order`, { params })
}
// 获取股票申购列表
export const stockList = (params) => {
   return request.get(`/v1/index/stock-subscribe`, { params })
}
// 创建申购列表
export const addStockList = (data) => {
   return request.post(`/v1/index/stock-subscribe-order`, data)
}
// 正在申购中的左侧列表
export const getstockList = (params) => {
   return request.get(`/v1/index/wait-new-subscribe-list`, { params })
}
// 获取OTC列表
export const getOtcList = (params) => {
   return request.get(`/v1/index/otc`, { params })
}
// 获取用户的OTC订单列表
export const getOtcOrder = (params) => {
   return request.get(`/v1/index/otc-order`, { params })
}
// 创建OTC订单
export const addOtcOrder = (data) => {
   return request.post(`/v1/index/otc-order`, data)
}
// 持仓列表
export const holdingOrder = (params) => {
   return request.get(`/v1/index/holding-order`, { params })
}
// 获取股票列表
// /v1/index/stock
export const stockList1 = (params) => {
   return request.get(`/v1/index/stocks`, { params })
}
// 获取自选股票
export const symbolsList = (params) => {
   return request.get(`/v1/index/symbols`, { params })
}
// 添加自选股票
export const addSymbols = (data) => {
   return request.post(`/v1/index/symbols`, data)
}
// 删除自选股票
export const delSymbols = (id) => {
   return request.delete(`/v1/index/symbols/${id}`)
}
// 搜索单个股票
export const searchSymbols = (symbol) => {
   return request.get(`/v1/index/search/${symbol}`)
}
// 获取单个股票详情的数据
export const stockItem = (id) => {
   return request.get(`/v1/index/stock/${id}`)
}
// 持仓---设置止盈止损
export const setholdingOrder = (id, data) => {
   return request.put(`/v1/index/holding-order/${id}`, data)
}
// 持仓---设置平仓
export const setSell = (id) => {
   return request.put(`/v1/index/sell/${id}`)
}
// 买入卖出
export const createHoldingOrder = (data) => {
   return request.post(`/v1/index/holding-order`, data)
}
// 获取k线数据
export const klineHistory = (params) => {
   return request.get(`/v1/index/history/kline`, { params })
}


// 获取k线数据
export const marketKline = (params) => {
   return request.get(`/v1/index/nasdaq100`, { params })
}


// 获取市场热力图
export const marketHeatmap = (params) => {
   return request.get(`/v1/index/heatmap-all`, { params })
}
